<!DOCTYPE html>
<html lang="zh-Hans">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,target-densitydpi=device-dpi,viewport-fit=cover">
  <style>
    html {
      font-size: 4.26667vw !important;
    }
  </style>
  <script>
    // css style：html {font-size: 4.26667vw !important;}
    // document.documentElement.clientWidth 文档宽度，视口宽度
    // window.innerWidth 屏幕宽度
    // document.documentElement.style.fontSize = (4.26667 * (document.documentElement.clientWidth || window.innerWidth)) + 'px';

    console.log(document.documentElement.style.fontSize);
    console.log(4.26667 * window.innerWidth);
  </script>
</head>

<body style="font-size:16px;">
  <span>字体1</span>
  <span style="font-size: 1rem;">字体2</span>
</body>

</html>